/*-
 * Copyright (c) 2006, 2007 FTS Team
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 4. Neither the name of the FTS Team nor the names of its contributors
 *    may be used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 *
 *      Ranker.hpp
 *
 * $FTS$
 */
#ifndef _RANKER_HPP__
#define _RANKER_HPP__ 1

/**
  @file Ranker.hpp
  @brief Fulltext search document ranker interface
*/
#include <Types.h>

namespace FTSS // FullTextSearchSystem
{

//FWD
class DocumentEntry;
class DocumentInfoStorage;
class IRConfig;
class InvIndexStorage;
class QueryWord;
class SnippetCollector;
class TimeProfiler;

/**
  @class Ranker Ranker.hpp <Ranker.hpp>
  @brief Document ranker
*/
class Ranker
{
public:
	/**
	  @brief A destructor
	*/
	virtual ~Ranker() throw() { ;; }

	/**
	  @brief Set source data
	  @param oIConfig - Global configuration
	  @param pIStorage - Inverted index sorage
	  @param pIDocumentInfoStorage - Plain index storage
	*/
	virtual void SetData(IRConfig             * oIConfig,
	                     InvIndexStorage      * pIStorage,
	                     DocumentInfoStorage  * pIDocumentInfoStorage) = 0;

	/**
	  @brief set
	  @param aDocuments
	  @param iDocumentsToRank
	  @param dQuorumRank
	  @param aAllWords
	  @param iTermsCount
	  @param iMaxWordPos
	  @param oSnippetCollector
	  @param oTimeProfiler
	*/
	virtual void Rank(DocumentEntry      ** aDocuments,
	                  const UINT_32       & iDocumentsToRank,
	                  const W_FLOAT       & dQuorumRank,
	                  QueryWord           * aAllWords,
	                  const UINT_32       & iTermsCount,
	                  const UINT_32       & iMaxWordPos,
	                  SnippetCollector    & oSnippetCollector,
	                  TimeProfiler        & oTimeProfiler) = 0;
};

} // namespace FTSS
#endif // _RANKER_HPP__
// End.
